package com.example.db2dm.entity;

public class MigrationResult {
    
    private String tableName;
    private MigrationStatus status;
    private long recordCount;
    private String errorMessage;
    private long duration; // milliseconds
    private Boolean columnCountConsistent; // 列数量是否一致，null表示未检查
    private Integer sourceColumnCount; // 源表列数
    private Integer targetColumnCount; // 目标表列数
    
    public MigrationResult() {}
    
    public MigrationResult(String tableName) {
        this.tableName = tableName;
        this.status = MigrationStatus.PENDING;
    }
    
    // Getters and Setters
    
    public String getTableName() {
        return tableName;
    }
    
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    
    public MigrationStatus getStatus() {
        return status;
    }
    
    public void setStatus(MigrationStatus status) {
        this.status = status;
    }
    
    public long getRecordCount() {
        return recordCount;
    }
    
    public void setRecordCount(long recordCount) {
        this.recordCount = recordCount;
    }
    
    public String getErrorMessage() {
        return errorMessage;
    }
    
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
    
    public long getDuration() {
        return duration;
    }
    
    public void setDuration(long duration) {
        this.duration = duration;
    }
    
    public Boolean getColumnCountConsistent() {
        return columnCountConsistent;
    }
    
    public void setColumnCountConsistent(Boolean columnCountConsistent) {
        this.columnCountConsistent = columnCountConsistent;
    }
    
    public Integer getSourceColumnCount() {
        return sourceColumnCount;
    }
    
    public void setSourceColumnCount(Integer sourceColumnCount) {
        this.sourceColumnCount = sourceColumnCount;
    }
    
    public Integer getTargetColumnCount() {
        return targetColumnCount;
    }
    
    public void setTargetColumnCount(Integer targetColumnCount) {
        this.targetColumnCount = targetColumnCount;
    }
    
    @Override
    public String toString() {
        return "MigrationResult{" +
                "tableName='" + tableName + '\'' +
                ", status=" + status +
                ", recordCount=" + recordCount +
                ", errorMessage='" + errorMessage + '\'' +
                ", duration=" + duration +
                ", columnCountConsistent=" + columnCountConsistent +
                ", sourceColumnCount=" + sourceColumnCount +
                ", targetColumnCount=" + targetColumnCount +
                '}';
    }
}